package com;

import java.io.IOException;

import org.apache.ibatis.executor.ErrorContext;
import org.apache.ibatis.session.SqlSessionFactory;
import org.mybatis.spring.SqlSessionFactoryBean;
import org.springframework.core.NestedIOException;

public class BeanFactory extends SqlSessionFactoryBean {

        protected SqlSessionFactory buildSqlSessionFactory() throws IOException {
            try{
                return super.buildSqlSessionFactory();
            }catch (NestedIOException e) {
                e.printStackTrace();
                throw new NestedIOException("Failed parse Mapping resource",e.getCause());
            }finally{
                ErrorContext.instance().reset();
            }
        }


}

